
import { Node } from 'cc';
import FragmentManager, { AddListener } from "../FragmentManager";
import View from "../view/View";
import { Fragment } from "./Fragment";


export class UIFragment extends Fragment {

    async addView(manager: FragmentManager, view: View, listener?: AddListener, params?: any): Promise<Node | null> {
        // 加载界面资源超时提示
        const timerId = setTimeout(manager.waitOpen, manager.config.timeout);
        const result = super.addView(manager, view, listener, params);
        // 倒计时移除
        clearTimeout(timerId);
        return result;
    }
}